Struct ImVectorWrapper<T>
Wrapper for ImVector.
Assembly: Dalamud.dll
View Source
public struct ImVectorWrapper<T> : IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IDisposable where T : unmanaged
Implements:
Expand
System.Collections.Generic.IList<<T>>
, System.Collections.Generic.ICollection<<T>>
, System.Collections.IList
, System.Collections.ICollection
, System.Collections.Generic.IReadOnlyList<<T>>
, System.Collections.Generic.IReadOnlyCollection<<T>>
, System.Collections.Generic.IEnumerable<<T>>
, System.Collections.IEnumerable
, System.IDisposable
Properties
RawVector
Gets the raw vector.
View Source
public ImVector* RawVector { get; }
DataSpan
Gets a System.Span%601
view of the underlying ImVector{T}, for the range of Dalamud.Interface.Utility.ImVectorWrapper%601.Length
.
View Source
public Span<T> DataSpan { get; }
StorageSpan
Gets a System.Span%601
view of the underlying ImVector{T}, for the range of Dalamud.Interface.Utility.ImVectorWrapper%601.Capacity
.
View Source
public Span<T> StorageSpan { get; }
IsDisposed
Gets a value indicating whether this Dalamud.Interface.Utility.ImVectorWrapper%601
is disposed.
View Source
public bool IsDisposed { get; }
HasOwnership
Gets a value indicating whether this Dalamud.Interface.Utility.ImVectorWrapper%601
has the ownership of the underlying
ImGuiNET.ImVector.
View Source
public readonly bool HasOwnership { get; }
Vector
Gets the underlying ImGuiNET.ImVector.
View Source
public ImVector* Vector { get; }
Length
Gets the number of items contained inside the underlying ImVector{T}.
View Source
public int Length { get; }
Capacity
Gets the number of items <b>that can be</b> contained inside the underlying ImVector{T}.
View Source
public int Capacity { get; }
Data
Gets the pointer to the first item in the data inside underlying ImVector{T}.
View Source
public T* Data { get; }
LengthUnsafe
Gets the reference to the number of items contained inside the underlying ImVector{T}.
View Source
public ref int LengthUnsafe { get; }
CapacityUnsafe
Gets the reference to the number of items <b>that can be</b> contained inside the underlying ImVector{T}.
View Source
public ref int CapacityUnsafe { get; }
DataUnsafe
Gets the reference to the pointer to the first item in the data inside underlying ImVector{T}.
View Source
public ref T* DataUnsafe { get; }
IsReadOnly
Gets a value indicating whether the System.Collections.Generic.ICollection%601
is read-only.
View Source
public bool IsReadOnly { get; }
this[int]
Gets the element at the specified index as a reference.
View Source
public ref T this[int index] { get; }
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
GetEnumerator()
Returns an enumerator that iterates through the collection.
View Source
public IEnumerator<T> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<<T>>
: An enumerator that can be used to iterate through the collection.### Add(in T)
Adds an item to the System.Collections.Generic.ICollection%601
.
View Source
public void Add(in T item)
Parameters
Type | Name | Description |
---|---|---|
<T> | item | The object to add to the System.Collections.Generic.ICollection%601 . |
Exceptions
System.NotSupportedException
The System.Collections.Generic.ICollection%601
is read-only.
AddRange(IEnumerable<T>)
Adds the elements of the specified collection to the end of the System.Collections.Generic.List%601
.
View Source
public void AddRange(IEnumerable<T> items)
Parameters
Type | Name |
---|---|
System.Collections.Generic.IEnumerable<<T>> | items |
Exceptions
System.ArgumentNullException
<code class="paramref">collection</code> is null.
AddRange(ReadOnlySpan<T>)
Adds the elements of the specified collection to the end of the System.Collections.Generic.List%601
.
View Source
public void AddRange(ReadOnlySpan<T> items)
Parameters
Type | Name |
---|---|
System.ReadOnlySpan<<T>> | items |
Exceptions
System.ArgumentNullException
<code class="paramref">collection</code> is null.
Clear()
Removes all items from the System.Collections.Generic.ICollection%601
.
View Source
public void Clear()
Exceptions
System.NotSupportedException
The System.Collections.Generic.ICollection%601
is read-only.
Clear(bool)
Clears this vector, optionally skipping destroyer invocation.
View Source
public void Clear(bool skipDestroyer)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | skipDestroyer | Whether to skip destroyer invocation. |
Contains(in T)
Determines whether the System.Collections.Generic.ICollection%601
contains a specific value.
View Source
public bool Contains(in T item)
Returns
System.Boolean
: true if <code class="paramref">item</code> is found in the System.Collections.Generic.ICollection%601
; otherwise, false.
Parameters
Type | Name | Description |
---|---|---|
<T> | item | The object to locate in the System.Collections.Generic.ICollection%601 . |
Compact(int)
Size down the underlying ImVector{T}.
View Source
public bool Compact(int reservation)
Returns
System.Boolean
: Whether the capacity has been changed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | reservation | Capacity to reserve. |
CopyTo(T[], int)
Copies the elements of the System.Collections.Generic.ICollection%601
to an System.Array
, starting at a particular System.Array
index.
View Source
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
<T>[] | array | The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection%601 . The System.Array must have zero-based indexing. |
System.Int32 | arrayIndex | The zero-based index in <code class="paramref">array</code> at which copying begins. |
Exceptions
System.ArgumentNullException
<code class="paramref">array</code> is null.
System.ArgumentOutOfRangeException
<code class="paramref">arrayIndex</code> is less than 0.
System.ArgumentException
The number of elements in the source System.Collections.Generic.ICollection%601
is greater than the available space from <code class="paramref">arrayIndex</code> to the end of the destination <code class="paramref">array</code>.
EnsureCapacity(int)
Ensures that the capacity of this list is at least the specified <code class="paramref">capacity</code>.
On growth, the new capacity exactly matches <code class="paramref">capacity</code>.
View Source
public bool EnsureCapacity(int capacity)
Returns
System.Boolean
: Whether the capacity has been changed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | The minimum capacity to ensure. |
EnsureCapacityExponential(int)
Ensures that the capacity of this list is at least the specified <code class="paramref">capacity</code>.
On growth, the new capacity may exceed <code class="paramref">capacity</code>.
View Source
public bool EnsureCapacityExponential(int capacity)
Returns
System.Boolean
: Whether the capacity has been changed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | The minimum capacity to ensure. |
Resize(int, in T, bool)
Resizes the underlying array and fills with zeroes if grown.
View Source
public void Resize(int size, in T defaultValue = default, bool skipDestroyer = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | size | New size. |
<T> | defaultValue | New default value. |
System.Boolean | skipDestroyer | Whether to skip calling destroyer function. |
Remove(in T)
Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection%601
.
View Source
public bool Remove(in T item)
Returns
System.Boolean
: true if <code class="paramref">item</code> was successfully removed from the System.Collections.Generic.ICollection%601
; otherwise, false. This method also returns false if <code class="paramref">item</code> is not found in the original System.Collections.Generic.ICollection%601
.
Parameters
Type | Name | Description |
---|---|---|
<T> | item | The object to remove from the System.Collections.Generic.ICollection%601 . |
Exceptions
System.NotSupportedException
The System.Collections.Generic.ICollection%601
is read-only.
IndexOf(in T)
Determines the index of a specific item in the System.Collections.Generic.IList%601
.
View Source
public int IndexOf(in T item)
Returns
System.Int32
: The index of <code class="paramref">item</code> if found in the list; otherwise, -1.
Parameters
Type | Name | Description |
---|---|---|
<T> | item | The object to locate in the System.Collections.Generic.IList%601 . |
Insert(int, in T)
Inserts an item to the System.Collections.Generic.IList%601
at the specified index.
View Source
public void Insert(int index, in T item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which <code class="paramref">item</code> should be inserted. |
<T> | item | The object to insert into the System.Collections.Generic.IList%601 . |
Exceptions
System.ArgumentOutOfRangeException
<code class="paramref">index</code> is not a valid index in the System.Collections.Generic.IList%601
.
System.NotSupportedException
The System.Collections.Generic.IList%601
is read-only.
InsertRange(int, IEnumerable<T>)
Inserts the elements of a collection into the System.Collections.Generic.List%601
at the specified index.
View Source
public void InsertRange(int index, IEnumerable<T> items)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which the new elements should be inserted. |
System.Collections.Generic.IEnumerable<<T>> | items |
Exceptions
System.ArgumentNullException
<code class="paramref">collection</code> is null.
System.ArgumentOutOfRangeException
<code class="paramref">index</code> is less than 0.
-or-
<code class="paramref">index</code> is greater than System.Collections.Generic.List%601.Count
.
InsertRange(int, ReadOnlySpan<T>)
Inserts the elements of a collection into the System.Collections.Generic.List%601
at the specified index.
View Source
public void InsertRange(int index, ReadOnlySpan<T> items)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which the new elements should be inserted. |
System.ReadOnlySpan<<T>> | items |
Exceptions
System.ArgumentNullException
<code class="paramref">collection</code> is null.
System.ArgumentOutOfRangeException
<code class="paramref">index</code> is less than 0.
-or-
<code class="paramref">index</code> is greater than System.Collections.Generic.List%601.Count
.
RemoveAt(int, bool)
Removes the element at the given index.
View Source
public void RemoveAt(int index, bool skipDestroyer = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
System.Boolean | skipDestroyer | Whether to skip calling the destroyer function. |
RemoveRange(int, int, bool)
Removes <code class="paramref">count</code> elements at the given index.
View Source
public void RemoveRange(int index, int count, bool skipDestroyer = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the first item to remove. |
System.Int32 | count | Number of items to remove. |
System.Boolean | skipDestroyer | Whether to skip calling the destroyer function. |
ReplaceRange(int, int, ReadOnlySpan<T>, bool)
Replaces a sequence at given offset <code class="paramref">index</code> of <code class="paramref">count</code> items with <code class="paramref">replacement</code>.
View Source
public void ReplaceRange(int index, int count, ReadOnlySpan<T> replacement, bool skipDestroyer = false)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the first item to be replaced. |
System.Int32 | count | The number of items to be replaced. |
System.ReadOnlySpan<<T>> | replacement | The replacement. |
System.Boolean | skipDestroyer | Whether to skip calling the destroyer function. |
SetCapacity(int)
Sets the capacity exactly as requested.
View Source
public bool SetCapacity(int capacity)
Returns
System.Boolean
: Whether the capacity has been changed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | capacity | New capacity. |
Exceptions
System.ArgumentOutOfRangeException
If <code class="paramref">capacity</code> is less than Dalamud.Interface.Utility.ImVectorWrapper%601.Length
.
System.OutOfMemoryException
If memory for the requested capacity cannot be allocated.
Implements
System.Collections.Generic.IList<<T>>
System.Collections.Generic.ICollection<<T>>
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<<T>>
System.Collections.Generic.IReadOnlyCollection<<T>>
System.Collections.Generic.IEnumerable<<T>>
System.Collections.IEnumerable
System.IDisposable